load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "stmtdiagnostics",
    srcs = ["statement_diagnostics.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/stmtdiagnostics",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/multitenant",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/isql",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/sql/types",
        "//pkg/util/intsets",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "stmtdiagnostics_test",
    size = "medium",
    srcs = [
        "main_test.go",
        "statement_diagnostics_helpers_test.go",
        "statement_diagnostics_test.go",
    ],
    embed = [":stmtdiagnostics"],
    tags = ["no-remote-exec"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/sqlerrors",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/syncutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
